﻿using System;
using FreeSql.DataAnnotations;
using ZhonTai.Admin.Core.Entities;
using ZhonTai.Industry.Domain.Offset;
using ZhonTai.Industry.Domain.PLCBlock;

#pragma warning disable CS8632

namespace ZhonTai.Industry.Domain.BlockOffset
{
    /// <summary>
    /// 数据块偏移量
    /// </summary>
    /// <remarks>数据块偏移量</remarks>
    [Table(Name = "cfg_block_offset")]
    public partial class BlockOffsetEntity : EntityBase
    {
        /// <summary>
        /// 数据块Id
        /// </summary>
        /// <remarks>数据块Id</remarks>
        [Column(Precision = 64)]
        public long BlockId { get; set; }

        /// <summary>
        /// 偏移量Id
        /// </summary>
        /// <remarks>偏移量Id</remarks>
        [Column(Precision = 64)]
        public long OffsetId { get; set; }

        /// <summary>
        /// 别名
        /// </summary>
        /// <remarks>别名</remarks>
        public string Another { get; set; }

        /// <summary>
        /// 分组名称
        /// </summary>
        /// <remarks>分组名称</remarks>
        [Column(StringLength = 64)]
        public string GroupName { get; set; }

        /// <summary>
        /// 是否订阅
        /// </summary>
        /// <remarks>是否订阅</remarks>
        public bool IsNoticed { get; set; }

        /// <summary>
        /// 订阅主题
        /// </summary>
        /// <remarks>订阅主题</remarks>
        [Column(StringLength = 64)]
        public string Topic { get; set; }

        /// <summary>
        /// 排序
        /// </summary>
        /// <remarks>排序</remarks>
        [Column(Precision = 10)]
        public int Sort { get; set; }

        /// <summary>
        /// 描述
        /// </summary>
        /// <remarks>描述</remarks>
        [Column(StringLength = 64)]
        public string Description { get; set; }

        /// <summary>
        /// 启用
        /// </summary>
        public bool Enabled { get; set; }

        /// <summary>
        /// 单位
        /// </summary>
        public string Unit { get; set; }

        /// <summary>
        /// 数据块
        /// </summary>
        [Navigate(nameof(BlockId))]
        public PLCBlockEntity PLCBlock { get; set; }

        /// <summary>
        /// 偏移量
        /// </summary>
        [Navigate(nameof(OffsetId))]
        public PLCOffsetEntity PLCOffset { get; set; }
    }
}

#pragma warning restore CS8632